package main;
/*
 * Things to check.
 * -All doors.
 * -Trunk
 * -Engine
 * -Do we care about windows being open?
 * -Do we care about any electronics being on in the car? Such as radio?
*/
public class Vehicle
{
	boolean	engine;
	boolean	driverDoor, passengerDoor, rearDriverDoor, rearPassengerDoor, trunkDoor;
	int battery;

	public Vehicle()
	{
		engine = false;
		driverDoor = false;
		passengerDoor = false;
		rearDriverDoor = false;
		rearPassengerDoor = false;
		trunkDoor = false;
		battery = 0;
	}

	/**
	 * Checks engine status.
	 * 
	 * @return True if on, False if off.
	 */
	public boolean isEngin()
	{
		return engine;
	}

	/**
	 * Set the engine on/off
	 * 
	 * @param engin
	 *            True if on, False if off.
	 */
	public void setEngin(boolean engine)
	{
		this.engine = engine;
	}

	/**
	 * Checks driverDoor status.
	 * 
	 * @return True if door is open, false if closed.
	 */
	public boolean isDriverDoor()
	{
		return driverDoor;
	}

	/**
	 * Set DriverDoor opened/closed.
	 * 
	 * @param driverDoor
	 *            True if open, False if closed.
	 */
	public void setDriverDoor(boolean driverDoor)
	{
		this.driverDoor = driverDoor;
	}

	/**
	 * Checks passengerDoor status.
	 * 
	 * @return True if door is open, false if closed.
	 */
	public boolean isPassengerDoor()
	{
		return passengerDoor;
	}

	/**
	 * Set passengerDoor opened/closed.
	 * 
	 * @param passengerDoor
	 *            True if open, False if closed.
	 */
	public void setPassengerDoor(boolean passengerDoor)
	{
		this.passengerDoor = passengerDoor;
	}

	/**
	 * Checks rearDriverDoor status.
	 * 
	 * @return True if door is open, false if closed.
	 */
	public boolean isRearDriverDoor()
	{
		return rearDriverDoor;
	}

	/**
	 * Set rearDriverDoor opened/closed.
	 * 
	 * @param rearDriverDoor
	 *            True if open, False if closed.
	 */
	public void setRearDriverDoor(boolean rearDriverDoor)
	{
		this.rearDriverDoor = rearDriverDoor;
	}

	/**
	 * Checks rearPassengerDoor status.
	 * 
	 * @return True if door is open, false if closed.
	 */
	public boolean isRearPassengerDoor()
	{
		return rearPassengerDoor;
	}

	/**
	 * Set rearPassengerDoor opened/closed.
	 * 
	 * @param rearPassengerDoor
	 *            True if open, False if closed.
	 */
	public void setRearPassengerDoor(boolean rearPassengerDoor)
	{
		this.rearPassengerDoor = rearPassengerDoor;
	}

	/**
	 * Checks trunk status.
	 * 
	 * @return True if trunk is open, false if closed.
	 */
	public boolean isTrunkDoor()
	{
		return trunkDoor;
	}

	/**
	 * Set trunk opened/closed.
	 * 
	 * @param trunkDoor
	 *            True if open, False if closed.
	 */
	public void setTrunkDoor(boolean trunkDoor)
	{
		this.trunkDoor = trunkDoor;
	}
	/**
	 * Checks the battery charge level.
	 * @return The int representation of the battery level.
	 */
	public int batteryLevel()
	{
		return battery;
	}
	/**
	 * Sets the battery level to the given value.
	 * @param x The value to set the battery to.  Must be between 0 and 100.
	 * @return True if valid level is set. False otherwise.
	 */
	private boolean setBattery(int x)
	{
		if(x < 0 || x > 100)
			return false;
		battery = x;
		return true;
	}
	public void chargeBattery()
	{
		setBattery(battery+1);
	}
	/**
	 * Checks to see if the battery is fully charged.
	 * @return True if battery is charge to 100%. False otherwise.
	 */
	public boolean isCharge()
	{
		if(battery == 100)
			return true;
		return false;
	}
}
